home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / info-service / gopher / Unix / xgopher.1.3 / Documents / Customization < prev    next >
Encoding:
Text File  |  1993-05-25  |  14.6 KB  |  343 lines

  1. Customizing Xgopher
  2. -------------------
  3. This document describes how an end user may change color, fonts, and
  4. other some behavior of Xgopher.  It also documents some other parameters
  5. that may be configured at installation time.
  6.  
  7. When we refer to setting an X resource we allow the readers to choose
  8. the methods that they are most familiar with already.  There are many
  9. ways to set resources for X Window System applications.  We refer you
  10. to a standard reference for X such as "X Window System User's Guide" by
  11. Quercia and O'Reilly, published by O'Reilly & Associates, Inc.
  12.  
  13. We also use the term "application defaults" as another way to refer to
  14. the resources of an application.
  15.  
  16.  
  17.  
  18. Color
  19. -----
  20.  
  21. When displayed on a black and white X display Xgopher will normally 
  22. have a white background and a black foreground.  That is, text, borders,
  23. and lines will be black on white.  If you prefer the opposite visual
  24. effect, you may use the standard X Toolkit option -rv on the command
  25. line or "reverseVideo: True" in your resources file.  The reverse
  26. video option is processed by all clients, including Xgopher, that use
  27. the X Toolkit for argument processing.  The effect of this option is
  28. to reverse all occurrences of the colors black and white.  (Some clients,
  29. such as Xterm, do not process -rv correctly.)
  30.  
  31. A suggested color scheme is distributed with Xgopher.  The easiest way
  32. to change colors is just to modify these supplied resources.  Most
  33. of those color resources are specified for an entire class of widget.
  34. For example, rather than setting the color of each button individually,
  35. the resources file contains the line
  36.  
  37.     Xgopher*Command*background:  LemonChiffon
  38.  
  39. Which sets the background for all widgets which are of class "Command"
  40. (the push button) or are subclasses of Command.  Note that class names
  41. are capitalized.
  42.  
  43. The internal border color resource (internalBorderColor) is not well
  44. known.  It separates the panes of the "paned" widget, the one used for
  45. the main Xgopher panel.  If you change the color of other lines and
  46. borders, be sure to change this one also.
  47.  
  48.  
  49.  
  50. Font
  51. ----
  52.  
  53. The fonts in the distributed resources file may be changed also.  Most
  54. of the Xgopher displays will size themselves according to the font
  55. selected.  The main Xgopher panel is an exception.  If you change the
  56. font size considerably from the default you may need to change the
  57. following resources:
  58.  
  59.     Xgopher*directoryForm.preferredPaneSize:  300
  60.     Xgopher*bookmarkForm.preferredPaneSize:   125
  61.     Xgopher*status.width:           500
  62.     Xgopher*directoryTitle.width:   500
  63.     Xgopher*bookmarkTitle.width:    500
  64.     Xgopher*directory.width:        500
  65.     Xgopher*bookmark.width:         500
  66.  
  67. The first two are the height in pixels of the initial directory and 
  68. bookmark areas of the main panel.  The last 5 should all be the same
  69. and are the width of the main panel in pixels.  You will probably have
  70. to determine these numbers from inspection after changing the fonts.
  71.  
  72. In the resources file are suggested alternative fonts for a larger 
  73. display to be read by more than one person at a time.  At the University
  74. of Illinois we use Xgopher on a 19-inch display with a touch screen
  75. instead of a mouse.  Here the font used for directory presentation is
  76. a 24-point font to allow reasonably accurate selection with a fingertip.
  77. This makes the main panel almost the height of the screen,
  78.  
  79.  
  80.  
  81. Text and Labels
  82. ---------------
  83.  
  84. Every button, menu item, and label have there text value defined in the
  85. resources file.  Some messages and most errors are constructed in the
  86. code itself and would be more difficult to change by the end user.
  87. The labels can be changed to make them more terse, more verbose, or
  88. non-English.  Xgopher does not use any I18N functions, so you are still
  89. restricted pretty much to the ISO Latin-1 character set.  This allows for
  90. most European languages to be used, but not many others.
  91.  
  92.  
  93.  
  94. Translations
  95. ------------
  96.  
  97. The X Toolkit defines a mapping from keyboard and mouse events to
  98. application-defined actions.  Some of these are built in to standard
  99. components, for example, "clicking" mouse button 1 inside a command
  100. (push button) widget will activate that function.  You may redefine
  101. this behavior if you wish.  Volume 4 of the O'Reilly series on the
  102. X window system provides a reference for this ("X Toolkit Intrinsics
  103. Programming Manual", by Nye and O'Reilly, O'Reilly & Associates, Inc).
  104.  
  105. For a one-button mouse or touch screen, the default scrollbar behavior
  106. is not usable.  The following translations work better:
  107.  
  108.   *Scrollbar.Translations: \
  109.       <Btn1Down>:   StartScroll(Continuous)MoveThumb()NotifyThumb()\n\
  110.       <Btn1Motion>: MoveThumb()NotifyThumb()\n\
  111.       <BtnUp>:   NotifyScroll(Proportional)EndScroll()\n\
  112.       <Key>F35:  StartScroll(Forward)NotifyScroll(Proportional)EndScroll()\n\
  113.       <Key>F29:  StartScroll(Backward)NotifyScroll(Proportional)EndScroll()\n
  114.  
  115. The first three lines allow button one alone to move up or down in the
  116. scrolling region by clicking or by dragging the "thumb".  The last two
  117. lines define the keys on a Sun SparcStation 1 keyboard labeled "PgDn"
  118. and "PgUp" to be used instead of the mouse to scroll down or up.
  119.  
  120. Xgopher also defines some of its own actions that you may define a 
  121. translation for.  Most of the text entry panels that accept only a 
  122. single line of input define an action for the "Ok" function.  The default
  123. translations for each of these defines a "return" ("enter") key press
  124. to invoke the "Ok" action.  If you press "return" on the file-save,
  125. index-search, or cso-name-server panels after entering text, it is the
  126. same as pressing the "Ok" (or "do query") function.
  127.  
  128. On the main Xgopher panel there is an "up" action defined equal to
  129. the "previous directory" button.  Pressing the "u" key while the X
  130. pointer is anywhere on the main panel will invoke this function.
  131.  
  132. All of the above translations may be eliminated or changed by modifying
  133. the translations in the resources file.
  134.  
  135.  
  136.  
  137. Size and constraint resources
  138. -----------------------------
  139.  
  140. Most of the resources in Xgopher are for setting the size or placement
  141. constraints on individual components of the user interface.  The 
  142. constraint widgets should not be changed by most people.  To change
  143. one of these may have consequences beyond that of changing a color for
  144. example.  Most of the constraint resources have been moved into the program
  145. (out of harm's way).
  146.  
  147. The size resources described in the above section on fonts may be safely
  148. changed, but usually are only changed to accommodate a larger or smaller
  149. character size.
  150.  
  151.  
  152.  
  153. Window Manager Behavior
  154. -----------------------
  155.  
  156. While not strictly an Xgopher customization option, the window manager
  157. may be configured to better interface with Xgopher.  Since Xgopher uses
  158. several top-level windows and transient windows some of these options may
  159. make Xgopher easier to use.  The two window managers in most common use
  160. are twm (and its descendents) and mwm.
  161.  
  162. Each of these has an option that will either automatically place a newly
  163. created window on the screen or allow the user to move and position
  164. an outline of the window first.
  165.  
  166. Another option available is whether to "decorate" transient windows.
  167. These are short-lived windows usually asking for information (e.g.,
  168. file-save or index-search).  The decorations are the title bar and various
  169. menu/kill/iconify type of buttons that usually are placed on or near the
  170. title bar.
  171.  
  172. Xgopher can be iconified with a silly-looking gopher icon.  
  173. A bitmap image is supplied in the directory ./bitmaps/xgopher.xbm
  174. which is suitable for use as a window manager icon.  If xgopher.xbm
  175. is installed into the directory <pathname>, you can use it as an
  176. icon bitmap under mwm by including the lines in your mwm resource
  177. file:
  178.  
  179.     Mwm*useClientIcon:              True
  180.     Mwm*Xgopher*iconImage:          <pathname>/xgopher.xbm
  181.  
  182. Similar resources apply to twm.  In your .twmrc file, use:
  183.  
  184.     # if the directory containing xgopher.xbm is not already
  185.     # in your bitmapFilePath, add:
  186.     IconDirectory                   "<pathname>/bitmaps"
  187.     Icons
  188.     {
  189.         "Xgopher"       "xgopher.xbm"
  190.     }
  191.  
  192. For both mwm and twm other resources may also affect your icon appearance.
  193.  
  194. You may want to install the icon file in the directory /usr/lib/X11/Xgopher/,
  195. or wherever the help file is already stored.  If you do put the icon bitmap
  196. somewhere, you may want to modify the Xgopher man page to provide this
  197. information to other users.
  198.  
  199. Finally, most window manager provide a main window menu that includes
  200. functions to move, resize, iconify, and terminate a window.  The
  201. termination function is processed specially by both the window manager
  202. and the application.  Xgopher complies with the window manager protocol
  203. that allows the window manager to ask the client to shut down rather
  204. than just suddenly and ungracefully killing the client application.
  205.  
  206. mwm's "f.kill" function will correctly inform Xgopher that a "remove"
  207. request has been made against a given window.  Xgopher will close and
  208. remove that window.  If the window is the main panel, Xgopher will quit.
  209.  
  210. twm's "f.delete" behaves in a manner similar to mwm's f.kill function.
  211. It is deficient in that for clients that do not honor the ICCCM
  212. conventions, f.delete will have no effect except to provide an audible
  213. beep.  twm's "f.destroy" function is quite harsh.  There is no intercepting
  214. its action.  It will simply destroy the entire application, no matter
  215. which window of the application was selected.  f.delete should be normally
  216. used in a windows main menu.  f.destroy should be used in only when
  217. absolutely necessary.  
  218.  
  219.  
  220.  
  221. Image display
  222. -------------
  223.  
  224. Xgopher displays an image file by invoking another command which must
  225. be already installed or available on your system (on the same host
  226. as is running the Xgopher program).  Normally, this auxiliary program
  227. is xloadimag.  You can change this and use another program by changing
  228. the resource:
  229.  
  230.     Xgopher.imageCommand: xloadimage
  231.  
  232. to use some other command.  If you have a program called "xv", another
  233. image display program, installed, that is a good alternative.  
  234.  
  235.  
  236.  
  237. Telnet and tn3270 sessions
  238. --------------------------
  239.  
  240. Xgopher provides a telnet or tn3270 session by invoking another command
  241. which must be already installed or available on your system (on the same
  242. host as is running the Xgopher program).  Normally, two additional
  243. programs are required: xterm and telnet (or xterm and tn3270).  xterm
  244. provides a new terminal emulator window with vt100 (or ansi) terminal
  245. behavior.  Telnet or tn3270 are simply run as programs in that window.
  246. You can change this and use another program by changing the resources:
  247.  
  248.     Xgopher.telnetCommand: xterm -e telnet
  249.     Xgopher.tn3270Command: xterm -e tn3270
  250.  
  251. to use some other command.  If you are using an IBM Risc System/6000, then
  252. you really should use aixterm to run tn3270 as xterm and tn3270 do not
  253. coexist very well with the default keyboard mappings.  For IBM RS/6000:
  254.  
  255.     Xgopher.tn3270Command: aixterm -e tn3270
  256.  
  257. If you have another telnet-capable program installed on your system,
  258. you may change these commands to use your own program.  One alternative
  259. for tn3270 sessions is a program called X3270.  If provides at least
  260. a better visual emulation of an IBM 3278 terminal than does tn3270
  261. in an xterm window.
  262.  
  263.  
  264.  
  265. Better Scrollbars
  266. -----------------
  267.  
  268. There is a modified scrollbar available for the Athena widget library
  269. that gives much better scrollbars than the standard Athena widget library
  270. does.  This improved scrollbar has arrow heads at each end of the bar
  271. that you can click to scroll up or down in addition to other scrollbar
  272. dragging actions for scrolling.  It is amazing how much these arrows add
  273. to the user interface.
  274.  
  275. This scrollbar widget was developed by Mitch Trachtenberg, bases on
  276. the Athena scrollbar widget and should be "plug compatible".
  277. However, it is not easy for me to support this widget directly in
  278. Xgopher.  The reason is that many computer systems have their
  279. Athena widget library generated as a shared object, or otherwise
  280. have the library already internally linked.  So, even if I provide
  281. the new scrollbar source file, and load it, the other Athena widgets
  282. (text and viewport) are already closely tied to the supplied scrollbar
  283. and will not use the new one.  The only sure way to use this new
  284. scrollbar is to re-build your Athena widget library using the 2 new
  285. files supplied by Mitch Trachtenberg.  It is okay to just re-archive
  286. your old ".o" files for Xaw.
  287.  
  288. I cannot support the use of this package, but I have tested it with 
  289. Xgopher on an IBM RS/6000, and really appreciated the appearance and
  290. behavior.  For those installers who feel like building a new Athena
  291. widget library, I recommend this scrollbar.
  292.  
  293. The shar file is available by anonymous ftp from:
  294.     
  295.     export.lcs.mit.edu: contrib/Xaw.Scrollbar.mta
  296.  
  297.  
  298.  
  299. Other Athena-Compatible Widgets
  300. -------------------------------
  301.  
  302. There is a 3-D version of the Athena widget library from
  303. kaleb@jpl-devvax.jpl.nasa.gov, also available on the X11 ftp site:
  304.  
  305.     export.lcs.mit.edu: contrib/Xaw-0.5.tar.Z
  306.  
  307. (That's the version current as of this writing at the end of 1992.)
  308.  
  309. It is "plug-compatible" with the standard Athena widget library.
  310. You can obtain this 3D version, compile it, (possibly install it,) and
  311. link Xgopher with this library instead of your system Xaw library.
  312.  
  313. I cannot support the use of this package, but I have tested it with
  314. Xgopher on an IBM RS/6000.  Especially when using color, there is some
  315. interesting visual effect, but I don't consider the added value
  316. significant enough to recommend using the 3D library.  Much of the
  317. problem stems from the fact that the Athena widgets are not beautiful.
  318. They were intended by the X consortium to be an example widget set, not
  319. necessarily a production one, and it shows (in any number of dimensions).
  320.  
  321.  
  322. There is also supposed to be a "vi" (editor) compatible version of the
  323. Athena text widget available.  I have not tested this widget.  I do not
  324. particularly recommend its use with Xgopher because  Xgopher
  325. is primarily a text display system rather than a text editing system.
  326. So the most you can gain is some familiar way to navigate a displayed
  327. text file.  However, you accomplish much of this by setting the
  328. key translations in the resource file for the existing text widget.
  329. The same installation considerations discussed above for the scrollbar
  330. replacement will be applicable to this replacement text widget.
  331. Here is the introductory paragraph from its distribution:
  332.  
  333.     This is a modified version of the X11R5 Text Widget.  It is designed
  334.     to drop into the X11R5 source tree and replace the original X11R5
  335.     Text Widget.  It will behave identically to the original, unless
  336.     the resource startMode is set to "vi", in which case it will give
  337.     you vi-like modal editing.  By Eric Bina.
  338.  
  339.     On export.lcs.mit.edu (00-index.txt):
  340.       -rw-rw-rw-  1 ftp         95091 Oct 22  1991 ViText.tar.Z
  341.  
  342.  
  343.